Setting up Twemoji with Thredded is simple.

First, add the [twemoji](https://github.com/twitter/twemoji) gem to your Gemfile.

```ruby
gem 'twemoji'
```

Then, create a pipeline filter:

```ruby
# lib/html_pipeline_twemoji.rb
require 'twemoji'
require 'twemoji/svg'
require 'html/pipeline/filter'

class HTMLPipelineTwemoji < HTML::Pipeline::Filter
  def call
    Twemoji.parse(doc, file_ext: 'svg', class_name: 'emoji')
  end
end
```

Then, add this filter to Thredded content pipeline:

```ruby
# config/initializers/thredded.rb
require 'html_pipeline_twemoji'

Thredded::ContentFormatter.after_markup_filters.insert(1, HTMLPipelineTwemoji)
```

Finally, add styles for the emoji:

```css
img.emoji {
  width: 1.429em;
  height: 1.429em;
  margin: 0 .05em 0 .1em;
  vertical-align: -0.35em;
  -webkit-user-drag: none;
}
```

<img title=":smile:" alt="😄" width="24" height="24" src="https://twemoji.maxcdn.com/2/svg/1f604.svg" class="emoji">

